<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台管理系统HTML模板--模板之家 www.cssmoban.com</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
    <script src="js/vue.min.js"></script>
    <script src="js/axios.min.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});
</script>


</head>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">数据表</a></li>
    <li><a href="#">基本内容</a></li>
    </ul>
    </div>
    
    <div class="rightinfo" id = "rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li class="click"><span><img src="images/t01.png" /></span><a href="/addMenu.html">添加</a></li>

        </ul>
        
        
        <ul class="toolbar1">
        <li><span><img src="images/t05.png" /></span>设置</li>
        </ul>
    
    </div>
    
    
    <table class="tablelist">
    	<thead>
    	<tr>
        <th>菜单名称<i class="sort"><img src="images/px.gif" /></i></th>
        <th>菜单描述</th>
        <th>请求地址</th>
        <th></th>
        </tr>
        <tr>
            <th colspan="5">一级菜单：
                <select v-model="menuId">
                    <option value="-1">请选择菜单</option>
                    <option v-for="menu in menuList" :value="menu.id">{{menu.pername}}</option>
                </select>
                <input type="button" value="搜索" @click="getMenuById()">
            </th>
        </tr>
        </thead>
        <tbody v-for="menu in menuListTwo" >
        <tr>
        <td>{{menu.pername}}</td>
        <td>{{menu.perdesc}}</td>
        <td>{{menu.url}}</td>
        </tr>
        </tbody>
    </table>
    
   
    <div class="pagin">
        <ul class="paginList">
        <li class="paginItem"><a href="javascript:;" @click="getMenuById(1)">首页</a></li>
        <li class="paginItem"><a href="javascript:;" @click="getMenuById(pageInfo.prePage)"><<</a></li>
        <li class="paginItem"><a href="javascript:;" @click="getMenuById(pageInfo.nextPage)">>> </a></li>
        <li class="paginItem"><a href="javascript:;" @click="getMenuById(pageInfo.pages)">尾页</a></li>
        </ul>
    </div>
    
    
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        
      <div class="tipinfo">
        <span><img src="images/ticon.png" /></span>
        <div class="tipright">
        <p>是否确认对信息的修改 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    
    </div>
    </div>
    
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>
</body>
<script>
    var vm = new Vue({
        el:"#rightinfo",
        data:{
          menuList:[],
            menuId :"-1",
            menuListTwo:[],
            pageInfo:""
        },
        created(){
            this.loadMenuList();
            this.getMenuById();
        },
        methods:{
            loadMenuList:function () {
                axios.get("getMenuListOne").then(function (obj) {
                    if(obj.status==200){
                        var pageResult = obj.data;
                        if(pageResult.code==100){
                            alert(pageResult.msg);
                            return;
                        }
                        vm.menuList = pageResult.result;
                    }
                }).catch(function (error) {
                    alert("查询异常"+error);
                });
            },
            getMenuById:function (page) {
                var param = {menuId: this.menuId,page:page};
                axios.get("getMenuById",{params:param}).then(function (obj) {
                    if(obj.status==200) {
                        var pageResult = obj.data;
                        if (pageResult.code == 100) {
                            alert(pageResult.msg);
                            return;
                        }
                        vm.menuListTwo = pageResult.object.list;
                        vm.pageInfo = pageResult.object;
                    }
                }).catch(function (error) {
                    alert("查询异常"+error);
                })
            }
        }
    });
</script>
</html>
